package org.sonar.template.java;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.sonar.plugins.java.api.JavaCheck;

import com.google.common.collect.ImmutableList;
import org.sonar.template.java.checks.AbstractClassNameRule;
import org.sonar.template.java.checks.UnusedPrivateFieldCheckRule;

/**
 * 规则的集合
 */
public final class JavaCustomRulesList {

    private JavaCustomRulesList() {
    }

    public static List<Class> getChecks() {
        return ImmutableList.<Class>builder().addAll(getJavaChecks()).addAll(getJavaTestChecks()).build();
    }

    /**
     * 自定义校验文件需要加到list中
     */
    public static List<Class<? extends JavaCheck>> getJavaChecks() {
        return Collections.unmodifiableList(Arrays.asList(
                AbstractClassNameRule.class,
                UnusedPrivateFieldCheckRule.class));
    }

    public static List<Class<? extends JavaCheck>> getJavaTestChecks() {
        return ImmutableList.<Class<? extends JavaCheck>>builder()
                // add HERE rules targeting test files
                .build();
    }
}
